
fn test_local(i: i32) {
	let a = 1;
	//let b = 3;
	println!("test_local: {:?}", a + i);
}
fn test_array(index: usize) {
	let mut xs: [i32; 1] = [9999];
	let mut b = xs[0];
	b += 1;
	xs[index] = b;
	println!("test_array: {:?}", xs[index])
}

fn test_box(i: i32) {
	let five = Box::new(5);
	let six = Box::new(6);
	let p: * mut i32;
	if i == 0 {
		p = Box::into_raw(five);
	} else {
		p = Box::into_raw(six);
	}
	unsafe {
		println!("test_box: {:?}", *p);
	}
}
fn test_reference1() {
	let five = Box::new(5);
	
	println!("test_reference1: {:?}", *five);
}
fn test_reference2(p: & i32) {
	println!("test_reference2: {:?}", *p);
}

fn main() {
    //println!("Hello, world!");
    test_array(1);
    test_box(0);
    test_local(4);
	let six = Box::new(6);
	test_reference1();
    test_reference2(&six);
}